@*
* Copyright 2016 LinkedIn Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*@
@(flowDefId: String, graphType: String, results: Html)

@newmain("Dr. Elephant - Flow History", "flowhistory") {

  <!-- The Search panel-->
  <div class="box shadow details-container history-top">

    <h4>Flow History</h4>
    <hr class="horizontal-line">
    <br/>
    <form class="box" id="flow-history-form" role="form" method="get" action="@routes.Application.flowHistory()">
      <div class="form-group">
        <label for="form-flow-def-idurl" >Flow Definition URL/ID</label>
        <input type="text" class="form-control" id="form-flow-def-id" name="flow-def-id" placeholder="Flow Definition URL/ID" value="@flowDefId">
      </div>
      <label for="graphType">Filter</label>
      <table>
        <tr>
          <td>
            <select onchange="this.form.submit()" class="form-control graph-select" name="select-graph-type" id="graphType" >

              @if(graphType == "resources") {
                <option value="resources" selected>Resources</option>
              } else {
                <option value="resources">Resources</option>
              }

              @if(graphType == "time") {
                <option value="time" selected>Time</option>
              } else {
                <option value="time">Time</option>
              }

              @if(graphType == "heuristics") {
                <option value="heuristics" selected>Heuristics</option>
              } else {
                <option value="heuristics">Heuristics</option>
              }
            </select></td>
          <td>
            <button type="submit" class="btn wf-button">Search</button>
          </td>
        </tr>
      </table>
    </form>
  </div>
  @results
}